//控制层 
app.controller('orderController',function($scope,$http ,$controller,orderService){
	
	//$controller('baseController' , {$scope:$scope});	//继承
	$scope.status = -1;
	if(localStorage.status){
		$scope.status = localStorage.status;
	}else{
		location.href="../login.html";
	}		
    $scope.schoolList=[];   //读取分驾校名称
    $http.get('../sealSchool/selectSchoolList.do').success(
			function(response){
				$scope.schoolList=response;
				console.log($scope.schoolList);
			}
	);		
	
				//分页控件配置 
				$scope.paginationConf = {
			         currentPage: 1,		//当前页码
			         totalItems: 10,		//总录数
			         itemsPerPage: 10,		//当前记录数
			         perPageOptions: [10, 20, 30, 40, 50],
			         onChange: function(){    		        	
			        		$scope.reloadList();//重新加载
			     	 }
				}; 
				
				//刷新列表
				$scope.reloadList=function(){
					$scope.search($scope.paginationConf.currentPage, $scope.paginationConf.itemsPerPage);
				}
	
	
	
    			
    			$scope.searchEntity={};
    			//条件查询
    			$scope.search=function(page, rows){
    				if($scope.status != 0){
        				$scope.searchEntity.status = $scope.status;   
        				console.log($scope.searchEntity.status);
        			}
    				orderService.search(page,rows,$scope.searchEntity).success(
    					function(response){
    						console.log(response)
    						$scope.list=response.rows;	//显示当前页数据
							$scope.paginationConf.totalItems=response.total;	//更新总记录数
    					}		
    				);
    			}
    	
    	
    	});